<?php

namespace App\Http\Controllers\Admin;

use App\Models\Comment;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CommentController extends Controller
{
    public function index()
    {
        $lists = Comment::with(['user','goods'])->get();
        return view('admin.comment.index',compact('lists'));
    }

    public function destory(Comment $comment,$id)
    {
        if($comment->destroyData($id)){
            return redirect()->back()->with('success','删除成功');
        }else{
            return redirect()->back()->with('danger','删除失败');
        }
    }
}
